<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>鼠标事件</title>
</head>
<body>
<div id="app">
    <!--默认情况下，只有左键会进行响应-->
    <div v-on:click="mouseClicked">单击</div>
    <!--在已知的系统中，只定义了左键双击-->
    <div v-on:dblclick="mouseDoubleClicked">双击</div>
    <div v-on:mouseenter="mouseEntered">移入</div>
    <div v-on:mouseleave="mouseleaved">移出</div>

</div>

<script type="module">
    import {createApp} from "../../../js/vue.esm-browser.js";

    let app = createApp(
        {
            setup() {
                function mouseClicked(event) {
                    console.log(event);
                }

                function mouseDoubleClicked(event) {
                    console.log(event);
                }

                function mouseEntered(event) {
                    console.log(event);
                }

                function mouseleaved(event) {
                    console.log(event);
                }

                return {
                    mouseClicked,
                    mouseDoubleClicked,
                    mouseEntered,
                    mouseleaved,
                }
            }
        }
    );

    app.mount("#app")
</script>
</body>
</html>